/**
 * @ author: 汪孟苹
 */
define(["jquery","template",
	"scprit/followup/app/healthAssess/healthPatient.servers.js",
	"scprit/followup/template/healthAssess/healthPatient.tpl.js"],
	function($,template,$healthPatientServers,tpl){
	var ui = {};

	var drawAutocomplete = function(){
		return template("tpl_health_autocomplete");
	}
	var drawPatents = function(data){
		return template("tpl_health_patients",data);
	}
	var drawTit = function(data){
		return template("tpl_health_tit",data);
	}
    
	ui.init = function(options){
		options.dom.html(tpl.init());
		var h = drawAutocomplete();
		options.dom.html(h);
	}

	ui.patentsInit = function(options){
		var data = {
			rows:$healthPatientServers.handlePatientsByPhone(options.list)
		}
		$("#"+options.id).html(tpl.init2());
		var h = drawPatents(data);
		$("#"+options.id).html(h);
	}

	ui.titInit = function(options){
		$("#"+options.id).html(tpl.init3());
		var h = drawTit(options);
		$("#"+options.id).html(h);
	}

	return ui;
});